import request from '@/utils/request'

// 查询短信配置列表
export function listConfig(query) {
  return request({
    url: '/prod-api/platform/config/list',
    method: 'get',
    params: query
  })
}

// 查询短信配置详细
export function getConfig(configId) {
  return request({
    url: '/prod-api/platform/config/' + configId,
    method: 'get'
  })
}

export function sendCode(phone) {
  let data = {phone:phone}
  return request({
    url: '/prod-api/platform/config/phoneCode',
    method: 'get',
    params: data
  })
}


// 新增短信配置
export function addConfig(data) {
  return request({
    url: '/prod-api/platform/config',
    method: 'post',
    data: data
  })
}


export function updateConfigStatus(uid,dataStatus) {
  let data = {
    configId:uid,
    dataStatus:dataStatus
  };
  return request({
    url: '/prod-api/platform/config',
    method: 'put',
    data: data
  })
}

// 修改短信配置
export function updateConfig(data) {
  return request({
    url: '/prod-api/platform/config',
    method: 'put',
    data: data
  })
}

// 删除短信配置
export function delConfig(configId) {
  return request({
    url: '/prod-api/platform/config/' + configId,
    method: 'delete'
  })
}



